<template>
  <div>
    <div class="space"></div>
    <div class="recommend-title">猜你喜欢</div>
    <router-link
      class="recommend-content"
      v-for="item of list"
      :key="item.id"
      border-bottom-1px
      :to="'/detail/' + item.id"
    >
      <div class="recommend-content-img">
        <div aspectratio w-100-100>
          <img :src="item.imgUrl" alt="" aspectratio-content>
        </div>
      </div>
      <div class="recommend-info">
        <h4>{{item.title}}</h4>
        <div class="comments">{{item.comments}}条评论</div>
      </div>
    </router-link>
  </div>
</template>

<script>
export default {
  name: 'HomeRecommend',
  props: {
    list: {
      type: Array
    }
  }
}
</script>

<style lang="stylus" scoped>
  @import '~styles/mixins.styl'
  .space
    height 14px
    background-color #ddd
  .recommend-title
    font-size 30px
    color #333
    box-sizing border-box
    padding 10px 0
    text-indent 18px
  .recommend-content
    display flex
    box-sizing border-box
    padding 15px
    .recommend-content-img
      width 200px
      height 200px
    .recommend-info
      flex 1
      min-width 0
      box-sizing border-box
      padding 15px
      h4
        font-size 30px
        color #333
        ellipsis()
        line-height 44px
        font-weight normal
        margin-bottom 10px
      .comments
        font-size 24px
        line-height 44px
        color #757575
        ellipsis()
</style>
